<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<button onclick="getXiaoMi()">跳转</button>
</body>
<script>
    //浏览器进行跳转
    function getXiaoMi(){
        var b = confirm("即将要跳转至小米官网，你确定要执行吗？");
        if (b){
            //实现页面跳转的代码、
            window.location.href="https://www.xiaomi.com"
        }else {
            console.log("取消跳转")
        }
    }
</script>
</html>